#include "sort.h"

void BubbleSort(vector<int>& vc){
  int end = vc.size()-1;
  while(end > 0)
  {
    bool exchange = false;
    for(int i = 0; i<end; ++i)
    {
      if(vc[i] > vc[i+1])
      {
        swap(vc[i], vc[i+1]);
        exchange = true;
      }
    }
    if(!exchange)
    {
      break;
    }
    --end;
  }
}
